<template>
	<!-- 考试结果 -->
	<view class="res-content">
		<view class="result-box">
			<view class="result-head">
				<image src="../../../static/index/椭圆 2 拷贝 2.png" mode=""></image>
				<view class="grade-box">
					<view>{{examTotal}}<text>分</text></view>
					<view>{{ parseInt(examTotal)>90? '恭喜你通过此次模拟考试':'继续加油'}}</view>
				</view>
			</view>
			<view class="btn">
				<u-button shape="circle" :custom-style="customStyle" @click="lookExamDetails">查看答题详情</u-button>
				<u-button shape="circle" :custom-style="customStyle1" type="success" @click='backExam'>返回模拟考试</u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:['examTotal'],
		data() {
			return {
				customStyle: {
					border: '1rpx solid #2AC092',
					color: '#2AC092'
				},
				customStyle1: {
					background: '#2AC092',
					color:"#fff"
				}
			}
		},
		methods:{
			backExam(){
				uni.navigateTo({
					url:'/pagesA/mockExam/index'
				})
			},
			lookExamDetails(){
				let that = this
				that.$emit('getSteps', 4);
			}
		}
	}
</script>

<style lang="scss">
	.result-box {
		width: 95%;
		margin: calc(20vmin/7.5) auto;
		padding-bottom: calc(20vmin/7.5);
		border-radius: calc(10vmin/7.5);
		background-color: #fff;

		.result-head {
			position: relative;

			>image {
				width: 100%;
				height: calc(420vmin/7.5);
			}

			.grade-box {
				position: absolute;
				width: 100%;
				height: 100%;
				top: 0;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;

				>view:nth-child(1) {
					width: calc(256vmin/7.5);
					height: calc(256vmin/7.5);
					background: #fff;
					border-radius: 50%;
					display: flex;
					align-items: center;
					justify-content: center;
					color: #2AC092;
					font-size: calc(96vmin/7.5);
					font-weight: bold;

					>text {
						font-size: calc(48vmin/7.5);
						font-weight: normal;
						margin-top: calc(15vmin/7.5);
						margin-left: calc(4vmin/7.5);
					}
				}

				>view:nth-child(2) {
					font-size: calc(42vmin/7.5);
					color: #fff;
					margin-top: calc(20vmin/7.5);
				}
			}
		}
	}
	.btn{
		display: flex;
		justify-content: space-around;
		margin-top: calc(20vmin/7.5);
	}
</style>